package com.smartfit;

public class AccelSensorData
{
	public final static float NOISE = 0.06f;
	
	public final static int SENSOR_PREV_DATA = 0;
	public final static int SENSOR_CURR_DATA = 1;
	
	public Axis3f[] acceleration = new Axis3f[2];
	public Axis3f[] velocity = new Axis3f[2];
	public Axis3f[] position = new Axis3f[2];
	
	public double fPitch;
	public double fRoll;
	public double fTheta;
	
	KalmanFilter filterX;
	KalmanFilter filterY;
	KalmanFilter filterZ;
	
	boolean initialized;
	
	AccelSensorData()
	{
		for ( int i = 0 ; i < 2 ; i++ )
		{
			acceleration[i] = new Axis3f();
			velocity[i] = new Axis3f();
			position[i] = new Axis3f();
		}
		
		filterX = new KalmanFilter();
		filterY = new KalmanFilter();
		filterZ = new KalmanFilter();
		
		Clear();
	}
	
	void Clear()
	{
		for ( int i = 0 ; i < 2 ; i++ )
		{
			acceleration[i].Clear();
			velocity[i].Clear();
			position[i].Clear();
		}
		
		filterX.Initialize( 0 );
		filterY.Initialize( 0 );
		filterZ.Initialize( 0 );
		
		fPitch = 0.0;
	    fRoll = 0.0;
	    fTheta = 0.0;
	
		initialized = false;
	}
}
